<?
$sub_menu = "300300";
include_once("./_common.php");

$g4[title] = "팝업창관리";
include_once("./admin.head.php");

$QUERY = "select * from $g4[popup_table] order by idx desc ";

$total_count = mysql_num_rows(mysql_query($QUERY));

$LINE_SU = 20;
$PAGE_SU = 5;
$total_page  = ceil($total_count / $LINE_SU);  // 전체 페이지 계산
if ($page == "") { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $LINE_SU; // 시작 열을 구함
$pagelist = get_paging($PAGE_SU, $page, $total_page, "$_SERVER[PHP_SELF]?$qstr&page=");

$QUERY.= "limit $from_record, $LINE_SU";
$RESULT = mysql_query($QUERY);
?>
<table cellpadding="0" cellspacing="0" border="1" width="700" class="table_line" align="center">
	<tr align="center">
		<td width="120" class="index">CODE</td>
		<td class="index">제목</td>
		<td width="80"class="index">사용중</td>
		<td width="140"class="index">등록일</td>
		<td width="60" class="index"><a href='./popup_form.php'><img src='<?=$g4[admin_path]?>/img/icon_insert.gif' border=0></a></td>
	</tr>
	<?
	while($LIST = mysql_fetch_array($RESULT))
	{
	?>
	<tr align="center" height="30">
		<td><?=$LIST[pop_code]?></td>
		<td><?=$LIST[pop_title]?></td>
		<td><?=$LIST[pop_use]?></td>
		<td><?=$LIST[pop_regday]?></td>
		<td>
		<img src='<?=$g4[admin_path]?>/img/icon_modify.gif' align="absmiddle" onclick="location.href='popup_form.php?Mode=UPDATE&IDX=<?=$LIST[idx]?>';">
		<img src='<?=$g4[admin_path]?>/img/icon_delete.gif' align="absmiddle" onclick="location.href='popup_update.php?Mode=DELETE&IDX=<?=$LIST[idx]?>';">
		</td>
	</tr>
	<?}?>
	<tr>
		<td colspan="5" align="center" height="40"><?=$pagelist?></td>
	</tr>
</table>
<?
include_once ("./admin.tail.php");
?>